/*
Author: Surpass-HC
Source: https://gitee.com/hxchuan000/clpc-1
Mail: surpass-hc@qq.com
*/
#pragma once
#include <lxFileOpt.h>
#include <linux/stat.h>
#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <sys/stat.h>
struct pipeOptStruct
{
    const char *pipFile; // pipe file with path name
    int fd;              // file descriptor
    uint32_t rdTmout;    // read time out ms
};
#define pipeOptDefault() \
    (struct pipeOptStruct) { NULL, -1, 0 }
#define pipeOptDefine(name) \
    struct pipeOptStruct name = (struct pipeOptStruct) { NULL, -1, 100 }
int pipeOptFree(struct pipeOptStruct *pipOpt);
int pipeOptOpen(struct pipeOptStruct *pipOpt);
int pipeOptInit(struct pipeOptStruct *pipOpt, const char *setfile, uint32_t setTmout);
int pipeOptRead(struct pipeOptStruct *pipOpt, char *outstr, int outsize);
int pipeOptWrite(struct pipeOptStruct *pipOpt, const char *optstr, int strsize);
int pipeOptWrtStr(struct pipeOptStruct *pipOpt, const char *optstr);
